@import '../../../../components/common/style/base.less';

@chat-markdown-table: ~'@{prefix}-chat-markdown-table';

.@{chat-markdown-table} {
  width: 100%;
  overflow-y: hidden;
  overflow-x: auto;
  border: 1rpx solid @component-border;

  &__container {
    display: table;
    min-width: 100%;
    max-width: max-content;
    border-collapse: collapse;
    white-space: nowrap;
  }

  &__thead {
    display: table-header-group;
  }

  &__tbody {
    display: table-row-group;
  }

  &__tr {
    display: table-row;
    border-bottom: 1rpx solid @component-border;

    &:last-child {
      border-bottom: none;
    }

    /* 斑马条纹样式 */
    &:nth-child(2n + 1) {
      background-color: @bg-color-container;
    }

    &:nth-child(2n) {
      background-color: @bg-color-secondarycontainer;
    }
  }

  &__th {
    display: table-cell;
    vertical-align: middle;
    background-color: @bg-color-secondarycontainer;
    padding: 5rpx 10rpx;
    color: @text-color-secondary;
    border-right: 1rpx solid @component-border;

    &:last-child {
      border-right: none;
    }
  }

  &__td {
    display: table-cell;
    vertical-align: middle;
    padding: 5rpx 10rpx;
    border-right: 1rpx solid @component-border;

    &:last-child {
      border-right: none;
    }
  }
}
